<?php 

include("ajaxinlcudes.php");

$colname_rs_resource = "-1";
if (isset($_GET['itemid'])) {
  $colname_rs_resource = $_GET['itemid'];
}
$rs_resource = getResourceDetails($colname_rs_resource);
$row_rs_resource = mysql_fetch_assoc($rs_resource);
$totalRows_rs_resource = mysql_num_rows($rs_resource);
?>
<h2>Resource &raquo; <span style="font-size: 70%;font-weight: normal"><?php echo $row_rs_resource['resource_url']; ?></span></h2>
<form id="form1" name="form1" method="post" action="">
</form>
<form action="<?php echo $editFormAction; ?>" method="post" name="form2" id="form2">
  <table align="center">
    <tr valign="baseline">
      <td width="148" align="right" nowrap="nowrap">Resource ID:</td>
      <td width="441"><?php echo $row_rs_resource['resource_id']; ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Category:</td>
      <td><?php echo $row_rs_resource['category_name']; ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Resource url:</td>
      <td>
    <?php  if($row_rs_resource['category_id']==7) { ?>
      <img name="" src="../resources/thump.php?im=<?php echo $row_rs_resource['resource_url']; ?>&sz=md" alt="" />
	  <?php } ?><?php echo $row_rs_resource['resource_url']; ?></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Description:</td>
      <td><textarea name="resourcedesc" cols="32"><?php echo htmlentities($row_rs_resource['resource_description'], ENT_COMPAT, ''); ?></textarea>
      A description of the (Image, Audio or resource)</td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Show:</td>
      <td><label>
          <select name="is_published" id="is_published">
              <option value="<?php echo $YES_OPTION; ?>">Yes</option>
            <option value="<?php echo N0_OPTION; ?>">No</option>
          </select>
      (yes would make it visible for all the users)</label></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">Source:</td>
      <td><input type="text" name="source" value="<?php echo htmlentities($row_rs_resource['source'], ENT_COMPAT, ''); ?>" size="32" /></td>
    </tr>
    <tr valign="baseline">
      <td nowrap="nowrap" align="right">&nbsp;</td>
      <td><input type="submit" value="Update record" /></td>
    </tr>
  </table>
  <input type="hidden" name="MM_update" value="updateResourceFrm" />
  <input type="hidden" name="resourceid" value="<?php echo $row_rs_resource['resource_id']; ?>" />
</form>
<p>&nbsp;</p>
<?php
mysql_free_result($rs_resource);
?>
